//题目：现有数组 int[] arr={1,2,3,4,5,6,7}。现需删除数组中索引为4的元素
public class test5 {
    public static void main(String[] args) {
        int[] arr={1,2,3,4,5,6,7};
        for (int i = 4; i < arr.length-1; i++) {
            arr[i]=arr[i+1];
        }
        arr[arr.length - 1] = 0;
        for (int i = 0; i < arr.length ; i++) {
            System.out.println(arr[i]);
        }
    }
}
